fun main() {
    val animals = listOf("zebra", "giraffe", "elephant", "rat")
    //链式调用。两个map:函数实编程范式支持的设计理念，不可变数据的副本在链上的函数间传递
    val babies = animals
        .map { animal -> "a baby $animal" }
        .map { baby -> "$baby, with the cutest little tail ever!" }
    println(animals)
    println(babies)

    val animalsLength = animals.map { it.length }
    println(animalsLength)
}